# -*- coding:UTF-8 -*- ＃
#!/usr/bin/python
'''
Created on 2013-5-2

@author: YANGCHENLONG
'''
import os,sys

class Error(Exception): pass
    
def _find(pathName, matchFunc=os.path.isfile):
    for d in sys.path:
        path = os.path.join(d,pathName)
        if matchFunc(path):
            return path
    raise Error("找不到该文件: %s" % pathName)

def findFile(pathName):
    return _find(pathName)

def findDir(path):
    return _find(path, matchFunc=os.path.isdir)